package 函数式接口.方法引用;

import java.util.function.Function;

public class 构造引用 {

    public static void main(String[] args) {

        method06(new Function<String, Person>() {
            @Override
            public Person apply(String string) {
                return new Person(string);
            }
        }, "张三");


        method06(string -> new Person(string), "张三");

        //   方法       apply      new
        //   参数       String     String
        //   返回值     Person     Person
// 对象类在前面
        method06(Person::new, "张三");

    }

    public static void method06(Function<String, Person> function, String name){
        Person apply = function.apply(name);
        System.out.println(apply);
    }


}
